package org.kong.utils;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 加油
 *
 * @author konglingfeng
 * @date 2025/7/5
 * @desc
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private int code;
    private String msg;
    private T data;

    public static <E> Result<E> success(String msg) {
        return new Result<E>(200,msg,null);
    }

    public static <E> Result<E> success(String msg, E data) {
        return new Result<E>(200,msg,data);
    }

    public static <E> Result<E> error(String msg) {
        return new Result<E>(0,msg,null);
    }
}
